#include "cpu/exec/template-start.h"

#define instr call

static void do_execute() {
	//call operation
	//1. save 
	cpu.esp -= 4;
    MEM_W(cpu.esp, cpu.eip+1+DATA_BYTE);
	//2. jump
	uint8_t op = instr_fetch(cpu.eip, 1);
	if(op==0xe8){
		if(ops_decoded.is_operand_size_16==true){
			cpu.eip  = (cpu.eip + op_src->val) & 0xFFFF;
		}else{
			cpu.eip  = cpu.eip + op_src->val;
		}
	}else if(op==0xff){
		if(ops_decoded.is_operand_size_16==true){
			cpu.eip  = (op_src->val & 0xFFFF) - 3;
		}else{
			cpu.eip  = (op_src->val) - 2;
		}	
	}
	print_asm_template2();
}

make_instr_helper(i)
make_instr_helper(rm)

#include "cpu/exec/template-end.h"